//index.js
//获取应用实例
const app = getApp()

Page({
  data:{
    flag:true,
    tabs:[
      { name:"个性推荐", active:true },
      { name: '歌单', active: false },
      { name: '主播电台', active: false },
      { name:'排行榜', active:false },
    ]
  },
  // 点击切换tab栏
  changeClassHandle:function(e){
    var i = e.target.dataset.id;
    this.data.tabs.forEach((item , index)=>{
      item.active = false;
      if(index == i){
        item.active = !item.active;
      }
    });
    this.setData({ tabs:this.data.tabs });
    
  },
  toSongListHandle(){
    wx.navigateTo({
      url:"../list/list"
    })
  }
})
